package com.zzh.takeoutapp.entity;


import android.content.Context;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.style.AbsoluteSizeSpan;

import com.google.gson.annotations.SerializedName;
import com.zzh.takeoutapp.view.goods.ViewUtils;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

public class FoodBean implements Serializable {


    private String id;
    private String name;//名
    private String sale;//销量
    private String isCommand;//是否推荐
    private BigDecimal price;//价格
    private String cut;//打折
    private String type;//类
    private int icon;//图片
    private long selectCount;

    public Map<String, String> getStringStringMap() {
        return stringStringMap;
    }

    public void setStringStringMap(Map<String, String> stringStringMap) {
        this.stringStringMap = stringStringMap;
    }

    private Map<String, String> stringStringMap;
    /**
     * product_id : 9587
     * shop_id : 63
     * cate_id : 682
     * title : 测试商品
     * photo : http://www.juh365.com/attachs/photo/201807/20180730_5D57AE7A106E37AA89351C37CC4C4292.gif_thumb.jpg
     * price : 11.00
     * package_price : 2.00
     * sales : 0
     * sale_type : 0
     * sale_sku : 9999
     * intro : 商品简介
     * is_spec : 0
     * good : 0
     * bad : 0
     * unit : 份
     * specification : [{"key":"测试属性名称","val":["测试属性"]}]
     * cate_ids : ["682","701"]
     * is_must : 0
     * specs : []
     * cate_str : 682,701
     * is_discount : 0
     * disctype : 0
     * discval : 100
     * oldprice : 11.00
     * diffprice : 0
     * huodong_id : 0
     * quota : 0
     * disclabel :
     * quotalabel :
     */

    private String product_id;
    private String shop_id;
    private String cate_id;
    private String title;
    private String photo;
    @SerializedName("price")
    private String priceX;
    private String package_price;
    private String sales;
    private String sale_type;
    private String sale_sku;
    private String intro;
    private String is_spec;
    private String good;
    private String bad;
    private String unit;
    private String is_must;
    private String cate_str;
    private String is_discount;
    private String disctype;
    private String discval;
    private String oldprice;
    private String diffprice;
    private String huodong_id;
    private String quota;
    private String disclabel;
    private String quotalabel;
    private List<SpecificationBean> specification;
    private List<String> cate_ids;

    public String getSpec_id_next() {
        return spec_id_next;
    }

    public void setSpec_id_next(String spec_id_next) {
        this.spec_id_next = spec_id_next;
    }

    private String spec_id_next;
    /**
     * is_hot : 0
     * specs : [{"spec_id":"3392","product_id":"9597","price":"68.00","package_price":"2.00","spec_name":"半只","spec_photo":"http://wm.hn796.net/attachs/photo/201808/20180822_3A2CF2E718CFE544294644E3FC813223.png_thumb.jpg","sale_sku":"9999","sale_count":"0","sale_type":"0","unit":"份","is_discount":"0","disctype":"0","discval":"100","oldprice":"68.00","diffprice":"0","huodong_id":"0","quota":"0","disclabel":"","quotalabel":""},{"spec_id":"3393","product_id":"9597","price":"128.00","package_price":"2.00","spec_name":"一只","spec_photo":"http://wm.hn796.net/attachs/photo/201808/20180822_3A2CF2E718CFE544294644E3FC813223.png_thumb.jpg","sale_sku":"9999","sale_count":"0","sale_type":"0","unit":"份","is_discount":"0","disctype":"0","discval":"100","oldprice":"128.00","diffprice":"0","huodong_id":"0","quota":"0","disclabel":"","quotalabel":""}]
     */

    private String is_hot;
    @SerializedName("specs")
    private List<SpecsBean> specsX;

    public long getSelectCount() {
        return selectCount;
    }

    public void setSelectCount(long selectCount) {
        this.selectCount = selectCount;
    }

    public int getIcon() {
        return icon;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public void setIcon(int icon) {
        this.icon = icon;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSale() {
        return sale;
    }

    public void setSale(String sale) {
        this.sale = sale;
    }

    public String getIsCommand() {
        return isCommand;
    }

    public void setIsCommand(String isCommand) {
        this.isCommand = isCommand;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public SpannableString getStrPrice(Context context) {
        String priceStr = String.valueOf(getPrice());
        SpannableString spanString = new SpannableString("¥" + priceStr);
        AbsoluteSizeSpan span = new AbsoluteSizeSpan(ViewUtils.sp2px(context, 11));
        spanString.setSpan(span, 0, 1, Spannable.SPAN_INCLUSIVE_INCLUSIVE);
        return spanString;
    }

    public SpannableString getStrPrice(Context context, BigDecimal price) {
        String priceStr = String.valueOf(price);
        SpannableString spanString = new SpannableString("¥" + priceStr);
        AbsoluteSizeSpan span = new AbsoluteSizeSpan(ViewUtils.sp2px(context, 11));
        spanString.setSpan(span, 0, 1, Spannable.SPAN_INCLUSIVE_INCLUSIVE);
        return spanString;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public String getCut() {
        return cut;
    }

    public void setCut(String cut) {
        this.cut = cut;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getProduct_id() {
        return product_id;
    }

    public void setProduct_id(String product_id) {
        this.product_id = product_id;
    }

    public String getShop_id() {
        return shop_id;
    }

    public void setShop_id(String shop_id) {
        this.shop_id = shop_id;
    }

    public String getCate_id() {
        return cate_id;
    }

    public void setCate_id(String cate_id) {
        this.cate_id = cate_id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getPhoto() {
        return photo;
    }

    public void setPhoto(String photo) {
        this.photo = photo;
    }

    public String getPriceX() {
        return priceX;
    }

    public void setPriceX(String priceX) {
        this.priceX = priceX;
    }

    public String getPackage_price() {
        return package_price;
    }

    public void setPackage_price(String package_price) {
        this.package_price = package_price;
    }

    public String getSales() {
        return sales;
    }

    public void setSales(String sales) {
        this.sales = sales;
    }

    public String getSale_type() {
        return sale_type;
    }

    public void setSale_type(String sale_type) {
        this.sale_type = sale_type;
    }

    public String getSale_sku() {
        return sale_sku;
    }

    public void setSale_sku(String sale_sku) {
        this.sale_sku = sale_sku;
    }

    public String getIntro() {
        return intro;
    }

    public void setIntro(String intro) {
        this.intro = intro;
    }

    public String getIs_spec() {
        return is_spec;
    }

    public void setIs_spec(String is_spec) {
        this.is_spec = is_spec;
    }

    public String getGood() {
        return good;
    }

    public void setGood(String good) {
        this.good = good;
    }

    public String getBad() {
        return bad;
    }

    public void setBad(String bad) {
        this.bad = bad;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public String getIs_must() {
        return is_must;
    }

    public void setIs_must(String is_must) {
        this.is_must = is_must;
    }

    public String getCate_str() {
        return cate_str;
    }

    public void setCate_str(String cate_str) {
        this.cate_str = cate_str;
    }

    public String getIs_discount() {
        return is_discount;
    }

    public void setIs_discount(String is_discount) {
        this.is_discount = is_discount;
    }

    public String getDisctype() {
        return disctype;
    }

    public void setDisctype(String disctype) {
        this.disctype = disctype;
    }

    public String getDiscval() {
        return discval;
    }

    public void setDiscval(String discval) {
        this.discval = discval;
    }

    public String getOldprice() {
        return oldprice;
    }

    public void setOldprice(String oldprice) {
        this.oldprice = oldprice;
    }

    public String getDiffprice() {
        return diffprice;
    }

    public void setDiffprice(String diffprice) {
        this.diffprice = diffprice;
    }

    public String getHuodong_id() {
        return huodong_id;
    }

    public void setHuodong_id(String huodong_id) {
        this.huodong_id = huodong_id;
    }

    public String getQuota() {
        return quota;
    }

    public void setQuota(String quota) {
        this.quota = quota;
    }

    public String getDisclabel() {
        return disclabel;
    }

    public void setDisclabel(String disclabel) {
        this.disclabel = disclabel;
    }

    public String getQuotalabel() {
        return quotalabel;
    }

    public void setQuotalabel(String quotalabel) {
        this.quotalabel = quotalabel;
    }

    public List<SpecificationBean> getSpecification() {
        return specification;
    }

    public void setSpecification(List<SpecificationBean> specification) {
        this.specification = specification;
    }

    public List<String> getCate_ids() {
        return cate_ids;
    }

    public void setCate_ids(List<String> cate_ids) {
        this.cate_ids = cate_ids;
    }


    public String getIs_hot() {
        return is_hot;
    }

    public void setIs_hot(String is_hot) {
        this.is_hot = is_hot;
    }

    public List<SpecsBean> getSpecsX() {
        return specsX;
    }

    public void setSpecsX(List<SpecsBean> specsX) {
        this.specsX = specsX;
    }

    public static class SpecificationBean implements Serializable {
        /**
         * key : 测试属性名称
         * val : ["测试属性"]
         */

        private String key;
        private List<String> val;

        public String getKey() {
            return key;
        }

        public void setKey(String key) {
            this.key = key;
        }

        public List<String> getVal() {
            return val;
        }

        public void setVal(List<String> val) {
            this.val = val;
        }
    }

    public static class SpecsBean implements Serializable {
        /**
         * spec_id : 3392
         * product_id : 9597
         * price : 68.00
         * package_price : 2.00
         * spec_name : 半只
         * spec_photo : http://wm.hn796.net/attachs/photo/201808/20180822_3A2CF2E718CFE544294644E3FC813223.png_thumb.jpg
         * sale_sku : 9999
         * sale_count : 0
         * sale_type : 0
         * unit : 份
         * is_discount : 0
         * disctype : 0
         * discval : 100
         * oldprice : 68.00
         * diffprice : 0
         * huodong_id : 0
         * quota : 0
         * disclabel :
         * quotalabel :
         */
        private String spec_id;
        @SerializedName("product_id")
        private String product_idX;
        @SerializedName("price")
        private String priceX;
        @SerializedName("package_price")
        private String package_priceX;
        private String spec_name;
        private String spec_photo;
        @SerializedName("sale_sku")
        private String sale_skuX;
        private String sale_count;
        @SerializedName("sale_type")
        private String sale_typeX;
        @SerializedName("unit")
        private String unitX;
        @SerializedName("is_discount")
        private String is_discountX;
        @SerializedName("disctype")
        private String disctypeX;
        @SerializedName("discval")
        private String discvalX;
        @SerializedName("oldprice")
        private String oldpriceX;
        @SerializedName("diffprice")
        private String diffpriceX;
        @SerializedName("huodong_id")
        private String huodong_idX;
        @SerializedName("quota")
        private String quotaX;
        @SerializedName("disclabel")
        private String disclabelX;
        @SerializedName("quotalabel")
        private String quotalabelX;

        public String getSpec_id() {
            return spec_id;
        }

        public void setSpec_id(String spec_id) {
            this.spec_id = spec_id;
        }

        public String getProduct_idX() {
            return product_idX;
        }

        public void setProduct_idX(String product_idX) {
            this.product_idX = product_idX;
        }

        public String getPriceX() {
            return priceX;
        }

        public void setPriceX(String priceX) {
            this.priceX = priceX;
        }

        public String getPackage_priceX() {
            return package_priceX;
        }

        public void setPackage_priceX(String package_priceX) {
            this.package_priceX = package_priceX;
        }

        public String getSpec_name() {
            return spec_name;
        }

        public void setSpec_name(String spec_name) {
            this.spec_name = spec_name;
        }

        public String getSpec_photo() {
            return spec_photo;
        }

        public void setSpec_photo(String spec_photo) {
            this.spec_photo = spec_photo;
        }

        public String getSale_skuX() {
            return sale_skuX;
        }

        public void setSale_skuX(String sale_skuX) {
            this.sale_skuX = sale_skuX;
        }

        public String getSale_count() {
            return sale_count;
        }

        public void setSale_count(String sale_count) {
            this.sale_count = sale_count;
        }

        public String getSale_typeX() {
            return sale_typeX;
        }

        public void setSale_typeX(String sale_typeX) {
            this.sale_typeX = sale_typeX;
        }

        public String getUnitX() {
            return unitX;
        }

        public void setUnitX(String unitX) {
            this.unitX = unitX;
        }

        public String getIs_discountX() {
            return is_discountX;
        }

        public void setIs_discountX(String is_discountX) {
            this.is_discountX = is_discountX;
        }

        public String getDisctypeX() {
            return disctypeX;
        }

        public void setDisctypeX(String disctypeX) {
            this.disctypeX = disctypeX;
        }

        public String getDiscvalX() {
            return discvalX;
        }

        public void setDiscvalX(String discvalX) {
            this.discvalX = discvalX;
        }

        public String getOldpriceX() {
            return oldpriceX;
        }

        public void setOldpriceX(String oldpriceX) {
            this.oldpriceX = oldpriceX;
        }

        public String getDiffpriceX() {
            return diffpriceX;
        }

        public void setDiffpriceX(String diffpriceX) {
            this.diffpriceX = diffpriceX;
        }

        public String getHuodong_idX() {
            return huodong_idX;
        }

        public void setHuodong_idX(String huodong_idX) {
            this.huodong_idX = huodong_idX;
        }

        public String getQuotaX() {
            return quotaX;
        }

        public void setQuotaX(String quotaX) {
            this.quotaX = quotaX;
        }

        public String getDisclabelX() {
            return disclabelX;
        }

        public void setDisclabelX(String disclabelX) {
            this.disclabelX = disclabelX;
        }

        public String getQuotalabelX() {
            return quotalabelX;
        }

        public void setQuotalabelX(String quotalabelX) {
            this.quotalabelX = quotalabelX;
        }
    }
}
